from flask import Flask,jsonify,render_template
import qiniu
app = Flask(__name__)


@app.route('/')
def hello_world():
    return render_template('index.html')

@app.route('/uptoken/')
def uptoken():
    access_key = 'p_p2-jutlTI1mlPCSfMEO8DyZnkQaiFrd9IOlvpz'
    secret_key = 'rN0YQux570vbhL5d8QvShrV-SnjzTdqhlfWstWri'
    q = qiniu.Auth(access_key,secret_key)
    bucket = 'wangfan91'
    token = q.upload_token(bucket)

    return jsonify({'uptoken':token})

if __name__ == '__main__':
    app.run()
